<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: wheels::threadPool类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../df/d8d/namespacewheels.html">wheels</a></li><li class="navelem"><a class="el" href="../../dd/d3f/classwheels_1_1thread_pool.html">threadPool</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="../../dd/df0/classwheels_1_1thread_pool-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">wheels::threadPool类 参考</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a>&gt;</code></p>
<div class="dynheader">
wheels::threadPool 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../db/d75/classwheels_1_1thread_pool__coll__graph.png" border="0" usemap="#awheels_1_1thread_pool_coll__map" alt="Collaboration graph"/></div>
<map name="awheels_1_1thread_pool_coll__map" id="awheels_1_1thread_pool_coll__map">
<area shape="rect" title=" " alt="" coords="5,5,197,357"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ae595e9efa0bb5043299aebb2dc465d8d" id="r_ae595e9efa0bb5043299aebb2dc465d8d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae595e9efa0bb5043299aebb2dc465d8d">threadPool</a> (size_t numThreads)</td></tr>
<tr class="separator:ae595e9efa0bb5043299aebb2dc465d8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fa995c772b6da5982074759457c891e" id="r_a7fa995c772b6da5982074759457c891e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7fa995c772b6da5982074759457c891e">threadPool</a> (size_t numThreads, int maxQueue)</td></tr>
<tr class="separator:a7fa995c772b6da5982074759457c891e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab28b774736a061198eba7e0a0d5c224f" id="r_ab28b774736a061198eba7e0a0d5c224f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab28b774736a061198eba7e0a0d5c224f">~threadPool</a> ()</td></tr>
<tr class="separator:ab28b774736a061198eba7e0a0d5c224f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74e3439e45bcbbde5dac5fe751daa8cd" id="r_a74e3439e45bcbbde5dac5fe751daa8cd"><td class="memTemplParams" colspan="2">template&lt;class F , class... Args&gt; </td></tr>
<tr class="memitem:a74e3439e45bcbbde5dac5fe751daa8cd"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a74e3439e45bcbbde5dac5fe751daa8cd">enqueue</a> (F &amp;&amp;f, Args &amp;&amp;... args) -&gt; std::future&lt; typename std::result_of&lt; F(Args...)&gt;::type &gt;</td></tr>
<tr class="memdesc:a74e3439e45bcbbde5dac5fe751daa8cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">排队任务  <br /></td></tr>
<tr class="separator:a74e3439e45bcbbde5dac5fe751daa8cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4d17e3e1887822be5169301771e8eab" id="r_ae4d17e3e1887822be5169301771e8eab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae4d17e3e1887822be5169301771e8eab">clearNotRunning</a> ()</td></tr>
<tr class="memdesc:ae4d17e3e1887822be5169301771e8eab"><td class="mdescLeft">&#160;</td><td class="mdescRight">清理掉还没有执行的任务  <br /></td></tr>
<tr class="separator:ae4d17e3e1887822be5169301771e8eab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a079473d51ebba64f27b45a7a157e2c49" id="r_a079473d51ebba64f27b45a7a157e2c49"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a079473d51ebba64f27b45a7a157e2c49">start</a> (bool sw=true)</td></tr>
<tr class="memdesc:a079473d51ebba64f27b45a7a157e2c49"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动或者停止线程  <br /></td></tr>
<tr class="separator:a079473d51ebba64f27b45a7a157e2c49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7608e77f566a0471a4afa5a42a9cc639" id="r_a7608e77f566a0471a4afa5a42a9cc639"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7608e77f566a0471a4afa5a42a9cc639">count</a> ()</td></tr>
<tr class="memdesc:a7608e77f566a0471a4afa5a42a9cc639"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取线程池容量  <br /></td></tr>
<tr class="separator:a7608e77f566a0471a4afa5a42a9cc639"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c16e4135132f173e6e9046fd2d8a837" id="r_a9c16e4135132f173e6e9046fd2d8a837"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9c16e4135132f173e6e9046fd2d8a837">count</a> (int count)</td></tr>
<tr class="memdesc:a9c16e4135132f173e6e9046fd2d8a837"><td class="mdescLeft">&#160;</td><td class="mdescRight">指定线程池容量，修改前线程池需要处于停止状态  <br /></td></tr>
<tr class="separator:a9c16e4135132f173e6e9046fd2d8a837"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b7e6345ee1a9b2eec83ada50b122c78" id="r_a9b7e6345ee1a9b2eec83ada50b122c78"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9b7e6345ee1a9b2eec83ada50b122c78">stop</a> ()</td></tr>
<tr class="separator:a9b7e6345ee1a9b2eec83ada50b122c78"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock">
<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00021">21</a> 行定义.</p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="ae595e9efa0bb5043299aebb2dc465d8d" name="ae595e9efa0bb5043299aebb2dc465d8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae595e9efa0bb5043299aebb2dc465d8d">&#9670;&#160;</a></span>threadPool() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">wheels::threadPool::threadPool </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>numThreads</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00059">59</a> 行定义.</p>

</div>
</div>
<a id="a7fa995c772b6da5982074759457c891e" name="a7fa995c772b6da5982074759457c891e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fa995c772b6da5982074759457c891e">&#9670;&#160;</a></span>threadPool() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">wheels::threadPool::threadPool </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>numThreads</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>maxQueue</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00060">60</a> 行定义.</p>

</div>
</div>
<a id="ab28b774736a061198eba7e0a0d5c224f" name="ab28b774736a061198eba7e0a0d5c224f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab28b774736a061198eba7e0a0d5c224f">&#9670;&#160;</a></span>~threadPool()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">wheels::threadPool::~threadPool </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00061">61</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_ab28b774736a061198eba7e0a0d5c224f_cgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_ab28b774736a061198eba7e0a0d5c224f_cgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_ab28b774736a061198eba7e0a0d5c224f_cgraph" id="add/d3f/classwheels_1_1thread_pool_ab28b774736a061198eba7e0a0d5c224f_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,138,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a9b7e6345ee1a9b2eec83ada50b122c78" title=" " alt="" coords="186,5,318,48"/>
<area shape="poly" title=" " alt="" coords="138,24,170,24,170,29,138,29"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a079473d51ebba64f27b45a7a157e2c49" title="启动或者停止线程" alt="" coords="366,5,498,48"/>
<area shape="poly" title=" " alt="" coords="318,24,351,24,351,29,318,29"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ae4d17e3e1887822be5169301771e8eab" title="清理掉还没有执行的任务" alt="" coords="546,5,679,48"/>
<area shape="poly" title=" " alt="" coords="499,24,531,24,531,29,499,29"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="ae4d17e3e1887822be5169301771e8eab" name="ae4d17e3e1887822be5169301771e8eab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4d17e3e1887822be5169301771e8eab">&#9670;&#160;</a></span>clearNotRunning()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void wheels::threadPool::clearNotRunning </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>清理掉还没有执行的任务 </p>

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00094">94</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_ae4d17e3e1887822be5169301771e8eab_icgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_ae4d17e3e1887822be5169301771e8eab_icgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_ae4d17e3e1887822be5169301771e8eab_icgraph" id="add/d3f/classwheels_1_1thread_pool_ae4d17e3e1887822be5169301771e8eab_icgraph">
<area shape="rect" title="清理掉还没有执行的任务" alt="" coords="563,35,696,77"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a079473d51ebba64f27b45a7a157e2c49" title="启动或者停止线程" alt="" coords="383,35,515,77"/>
<area shape="poly" title=" " alt="" coords="548,59,516,59,516,53,548,53"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a9b7e6345ee1a9b2eec83ada50b122c78" title=" " alt="" coords="194,5,326,48"/>
<area shape="poly" title=" " alt="" coords="367,46,327,40,327,34,368,41"/>
<area shape="rect" href="../../dd/dd6/structssl_svr_itfc.html#aa65a5eeb17702fe20f8478eaf0baf08c" title=" " alt="" coords="186,72,335,99"/>
<area shape="poly" title=" " alt="" coords="368,71,336,76,335,71,367,66"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ab28b774736a061198eba7e0a0d5c224f" title=" " alt="" coords="5,5,138,48"/>
<area shape="poly" title=" " alt="" coords="179,29,138,29,138,24,179,24"/>
</map>
</div>

</div>
</div>
<a id="a7608e77f566a0471a4afa5a42a9cc639" name="a7608e77f566a0471a4afa5a42a9cc639"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7608e77f566a0471a4afa5a42a9cc639">&#9670;&#160;</a></span>count() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int wheels::threadPool::count </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取线程池容量 </p>

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00130">130</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a7608e77f566a0471a4afa5a42a9cc639_icgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a7608e77f566a0471a4afa5a42a9cc639_icgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a7608e77f566a0471a4afa5a42a9cc639_icgraph" id="add/d3f/classwheels_1_1thread_pool_a7608e77f566a0471a4afa5a42a9cc639_icgraph">
<area shape="rect" title="获取线程池容量" alt="" coords="186,5,318,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a9c16e4135132f173e6e9046fd2d8a837" title="指定线程池容量，修改前线程池需要处于停止状态" alt="" coords="5,5,138,48"/>
<area shape="poly" title=" " alt="" coords="170,29,138,29,138,24,170,24"/>
</map>
</div>

</div>
</div>
<a id="a9c16e4135132f173e6e9046fd2d8a837" name="a9c16e4135132f173e6e9046fd2d8a837"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c16e4135132f173e6e9046fd2d8a837">&#9670;&#160;</a></span>count() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool wheels::threadPool::count </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>count</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>指定线程池容量，修改前线程池需要处于停止状态 </p>
<dl class="section return"><dt>返回</dt><dd>成功操作返回true，否则返回false </dd></dl>

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00135">135</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a9c16e4135132f173e6e9046fd2d8a837_cgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a9c16e4135132f173e6e9046fd2d8a837_cgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a9c16e4135132f173e6e9046fd2d8a837_cgraph" id="add/d3f/classwheels_1_1thread_pool_a9c16e4135132f173e6e9046fd2d8a837_cgraph">
<area shape="rect" title="指定线程池容量，修改前线程池需要处于停止状态" alt="" coords="5,5,138,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a7608e77f566a0471a4afa5a42a9cc639" title="获取线程池容量" alt="" coords="186,5,318,48"/>
<area shape="poly" title=" " alt="" coords="138,24,170,24,170,29,138,29"/>
</map>
</div>

</div>
</div>
<a id="a74e3439e45bcbbde5dac5fe751daa8cd" name="a74e3439e45bcbbde5dac5fe751daa8cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a74e3439e45bcbbde5dac5fe751daa8cd">&#9670;&#160;</a></span>enqueue()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class F , class... Args&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">auto wheels::threadPool::enqueue </td>
          <td>(</td>
          <td class="paramtype">F &amp;&amp;</td>          <td class="paramname"><span class="paramname"><em>f</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Args &amp;&amp;...</td>          <td class="paramname"><span class="paramname"><em>args</em></span>&#160;) -&gt; std::future&lt;typename std::result_of&lt;F(Args...)&gt;::type&gt; </td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>排队任务 </p>
<dl class="tparams"><dt>模板参数</dt><dd>
  <table class="tparams">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>
<p>tparam </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td></td></tr>
    <tr><td class="paramname">args</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回一个std::future对象，方便后续获取返回值 </dd></dl>

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00071">71</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a74e3439e45bcbbde5dac5fe751daa8cd_icgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a74e3439e45bcbbde5dac5fe751daa8cd_icgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a74e3439e45bcbbde5dac5fe751daa8cd_icgraph" id="add/d3f/classwheels_1_1thread_pool_a74e3439e45bcbbde5dac5fe751daa8cd_icgraph">
<area shape="rect" title="排队任务" alt="" coords="215,5,347,48"/>
<area shape="rect" href="../../d9/d86/classssl_svr_epoll.html#a9eb56417e377f8ddf2556342bb6c4470" title=" " alt="" coords="5,13,167,40"/>
<area shape="poly" title=" " alt="" coords="199,29,167,29,167,24,199,24"/>
</map>
</div>

</div>
</div>
<a id="a079473d51ebba64f27b45a7a157e2c49" name="a079473d51ebba64f27b45a7a157e2c49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a079473d51ebba64f27b45a7a157e2c49">&#9670;&#160;</a></span>start()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void wheels::threadPool::start </td>
          <td>(</td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>sw</em></span><span class="paramdefsep"> = </span><span class="paramdefval">true</span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>启动或者停止线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">sw[</td><td>I ], true启动线程池；false结束线程池 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00104">104</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_cgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_cgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_cgraph" id="add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_cgraph">
<area shape="rect" title="启动或者停止线程" alt="" coords="5,5,138,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ae4d17e3e1887822be5169301771e8eab" title="清理掉还没有执行的任务" alt="" coords="186,5,318,48"/>
<area shape="poly" title=" " alt="" coords="138,24,170,24,170,29,138,29"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_icgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_icgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_icgraph" id="add/d3f/classwheels_1_1thread_pool_a079473d51ebba64f27b45a7a157e2c49_icgraph">
<area shape="rect" title="启动或者停止线程" alt="" coords="383,35,515,77"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a9b7e6345ee1a9b2eec83ada50b122c78" title=" " alt="" coords="194,5,326,48"/>
<area shape="poly" title=" " alt="" coords="367,46,327,40,327,34,368,41"/>
<area shape="rect" href="../../dd/dd6/structssl_svr_itfc.html#aa65a5eeb17702fe20f8478eaf0baf08c" title=" " alt="" coords="186,72,335,99"/>
<area shape="poly" title=" " alt="" coords="368,71,336,76,335,71,367,66"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ab28b774736a061198eba7e0a0d5c224f" title=" " alt="" coords="5,5,138,48"/>
<area shape="poly" title=" " alt="" coords="179,29,138,29,138,24,179,24"/>
</map>
</div>

</div>
</div>
<a id="a9b7e6345ee1a9b2eec83ada50b122c78" name="a9b7e6345ee1a9b2eec83ada50b122c78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b7e6345ee1a9b2eec83ada50b122c78">&#9670;&#160;</a></span>stop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void wheels::threadPool::stop </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a> 第 <a class="el" href="../../dd/dce/thread_pool_8hpp_source.html#l00144">144</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_cgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_cgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_cgraph" id="add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,138,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#a079473d51ebba64f27b45a7a157e2c49" title="启动或者停止线程" alt="" coords="186,5,318,48"/>
<area shape="poly" title=" " alt="" coords="138,24,170,24,170,29,138,29"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ae4d17e3e1887822be5169301771e8eab" title="清理掉还没有执行的任务" alt="" coords="366,5,498,48"/>
<area shape="poly" title=" " alt="" coords="318,24,351,24,351,29,318,29"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dd/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_icgraph.png" border="0" usemap="#add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_icgraph" alt=""/></div>
<map name="add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_icgraph" id="add/d3f/classwheels_1_1thread_pool_a9b7e6345ee1a9b2eec83ada50b122c78_icgraph">
<area shape="rect" title=" " alt="" coords="186,5,318,48"/>
<area shape="rect" href="../../dd/d3f/classwheels_1_1thread_pool.html#ab28b774736a061198eba7e0a0d5c224f" title=" " alt="" coords="5,5,138,48"/>
<area shape="poly" title=" " alt="" coords="170,29,138,29,138,24,170,24"/>
</map>
</div>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/<a class="el" href="../../dd/dce/thread_pool_8hpp_source.html">threadPool.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
